import React from 'react';
import {
    BrowserRouter as Router,// 指定路由模式为history
    Route,// 路由，必须直接被Routes所包裹
    Routes,// 包裹路由
    Navigate,// 重定向
    NavLink,// 可以实现导航链接
} from "react-router-dom";
import Home from "./pages/Home";
import NotFound from "./pages/NotFound";
import GoodsList from "./pages/GoodsList";
import NewsList from "./pages/NewsList";
import My from "./pages/My";
import MyNavLink from "./components/MyNavLink";
import "./App.css";
function App(props) {
    return (
        <div id={"container"}>
           <MyNavLink/>
            <Routes>
                <Route path={"*"} element={<NotFound/>}></Route>
                <Route path={"/"} element={<Home/>}></Route>
                <Route path={"/goodsList"} element={<GoodsList/>}></Route>
                <Route path={"/newsList"} element={<NewsList/>}></Route>
                <Route path={"/my"} element={<My/>}></Route>
                {/*重定向：当地址为/home,跳转至路由地址为/的路由中*/}
                <Route path={"/home"} element={<Navigate to={"/"}/>}></Route>
            </Routes>
        </div>

    );
}

export default App;